* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  /* CSS函数创建了一个图像，该图像是由从原点发出的两种或者多种颜色之间的逐步过渡组成。 */
  background: radial-gradient(circle at center, #555, #000);
}

.container {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.container a {
  position: relative;
  /* 将行内元素转为块级元素, 否则不能给宽高 */
  display: block;
  width: 140px;
  height: 60px;
  line-height: 60px;
  text-align: center;
  margin-top: 80px;
  text-decoration: none;
  font-size: 20px;
  color: plum;

  /* 添加过渡 */
  transition: all 0.3s ease-in-out;

  /* 改变各个 a 标签的颜色【重点】 */
  filter: hue-rotate(calc(var(--i) * 60deg));
}

.container a::before,
.container a::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid plum;

  /* 最后的 0.3s 是添加延迟 */
  transition: all 0.3s ease-in-out;
}

.container a::before {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
}

.container a::after {
  bottom: 0;
  right: 0;
  border-top: 0;
  border-left: 0;
}

.container a:hover {
  background-color: plum;
  color: #000;
  /* 添加阴影（发光效果） */
  box-shadow: 0 0 50px plum;

  /* 给盒子添加倒影 */
  -webkit-box-reflect: below 1px
    linear-gradient(transparent, rgba(0, 0, 0, 0.3));

  /* 添加过渡延迟事件 */
  transition-delay: 0.4s;
}

.container a:hover::before,
.container a:hover::after {
  width: 138px;
  height: 58px;
}
